package cn.house.rent.mapper;

import cn.house.rent.entity.HouseImg;
import cn.house.rent.entity.HouseInfo;
import cn.house.rent.entity.User;
import cn.house.rent.vo.HouseVo;
import cn.house.rent.vo.TenantHomeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface HouseMapper {

    //我的家模块查询和搜索查询
    List<TenantHomeVo> selectTenantHome(@Param("user") User user,@Param("houseVo") HouseVo houseVo);

    //根据房屋id查询房屋信息
    HouseInfo selectById(@Param("houseId") Integer houseId);

    //根据房屋id查询房屋名
    String selectByIdName(@Param("houseId") Integer houseId);

    //根据用户id 查询该用户所有发布的房源信息
    List<HouseVo> selectByLandId(@Param("user") User user, @Param("houseVo") HouseVo houseVo);

    //根据房屋id查询房屋信息及房东信息
    HouseVo getHouseAllById(@Param("houseId") Integer houseId);

    //通过房屋id查房屋图片
    List<HouseImg> getHouseImgById(@Param("houseId") Integer houseId);

    //根据条件查房屋信息
    List<HouseVo> getHouseByInfo(@Param("house") HouseVo house);

    //根据房屋id修改房屋状态
    int updateHouseStatusById(@Param("tenantHouse")TenantHomeVo tenantHomeVo);

    //根据房屋id删除房屋
    int delHouseById(TenantHomeVo tenantHomeVo);

    //根据房屋id删除对应房屋图片
    int delHouseByIdImg(TenantHomeVo tenantHomeVo);

    //添加房源
    int addHouse(HouseVo houseVo);

    //添加图片
    int addHouseImg(@Param("houseImgs") String[] houseImgs,@Param("houseId") Integer houseId);

    //根据id修改房屋信息
    int updateHouseById(HouseVo houseVo);
}
